#!/usr/bin/python2.5

import itertools
import optparse
import sys

parser = optparse.OptionParser()
parser.add_option("-w", "--warlocks", help="warlocks", default="war1 war2")
parser.add_option("-d", "--druids", help="druids", default="druid1 druid2")
parser.add_option("-m", "--mages", help="mages", default="mage1 mage2")
parser.add_option("-n", "--npcs", help="npcs", default="npc1 npc2 npc3 npc4 npc5 npc6")
parser.add_option("", "--heroic", help="heroic mode", default=False, action="store_true")

options, args = parser.parse_args(sys.argv)
warlocks = options.warlocks.split()
druids = options.druids.split()
mages = options.mages.split()
npcs = options.npcs.split()

multiple = (1, 2)[options.heroic]

assert len(warlocks) == multiple
assert len(druids) == multiple
assert len(mages) == multiple
assert len(npcs) == 3 * multiple

npcs = itertools.cycle(npcs)

if not options.heroic:
  print "%s: %s %s %s" % (warlocks[0], npcs.next(), npcs.next(), npcs.next())
  npcs.next()
  print "%s: %s %s %s" % (mages[0], npcs.next(), npcs.next(), npcs.next())
  npcs.next()
  print "%s: %s %s %s" % (druids[0], npcs.next(), npcs.next(), npcs.next())
else:
  print "%s: %s %s %s" % (warlocks[0], npcs.next(), npcs.next(), npcs.next())
  print "%s: %s %s %s" % (warlocks[1], npcs.next(), npcs.next(), npcs.next())
  npcs.next()
  print "%s: %s %s %s" % (mages[0], npcs.next(), npcs.next(), npcs.next())
  print "%s: %s %s %s" % (mages[1], npcs.next(), npcs.next(), npcs.next())
  npcs.next()
  print "%s: %s %s %s" % (druids[0], npcs.next(), npcs.next(), npcs.next())
  print "%s: %s %s %s" % (druids[1], npcs.next(), npcs.next(), npcs.next())
